package org.chs.ts.batch.factory;



import java.util.Locale;

/**
 * @Compay 盛唐天行
 * @Author: wuwei
 * @Censor By wuwei
 * @Sence 2023/1/9 15:56
 * @Modify 2023/1/9 15:56
 * @Description 序列号工厂类
 */
public class SernoFactory {
    //private static final Logger log = LoggerFactory.getLogger(SernoFactory.class);

    public static String createSerno(String sernoType){
        switch (sernoType.toLowerCase(Locale.ROOT)){
            case "task":
                return createLogSerno("batch");
            case "taskstep":
                return createLogSerno("batchStep");
            case "threadrejected":
                return createLogSerno("threadrejected");
            case "taskpubid":
                return createLogSerno("taskPubId");
            default:
                return "";
        }
    }

    public static String createDailyTaskStepExecTaskPubId(String taskPubId ,String execTime){
        return taskPubId.toUpperCase(Locale.ROOT)+"@"+execTime;
    }

    private static String createLogSerno(String tasklogType) {
        return tasklogType.toUpperCase(Locale.ROOT)+System.currentTimeMillis();
    }

}
